package com.chiancloud.shield.core.exception;

import com.chiancloud.shield.core.main.ExitCodeProvider;
import com.chiancloud.shield.core.main.LauncherExitCodes;
import org.apache.hadoop.yarn.exceptions.YarnException;

/**
 * Created by wanghui on 14-8-20.
 */
public class ServiceLaunchException extends YarnException
        implements ExitCodeProvider,LauncherExitCodes{

    private final int exitCode;

    public ServiceLaunchException(int exitCode, Throwable cause) {
        super(cause);
        this.exitCode = exitCode;
    }

    public ServiceLaunchException(int exitCode, String message) {
        super(message);
        this.exitCode = exitCode;
    }


    public ServiceLaunchException(int exitCode, String message, Throwable cause) {
        super(message, cause);
        this.exitCode = exitCode;
    }

    @Override
    public int getExitCode() {
        return exitCode;
    }
}
